<?php
/**
 * Comments.php 
 *
 */

// Do not delete these lines
	if ( !empty( $_SERVER[ 'SCRIPT_FILENAME' ] ) && 'comments.php' == basename( $_SERVER[ 'SCRIPT_FILENAME' ] ) )
		die ( 'Please do not load this page directly. Thanks!' );

	if ( post_password_required() ) { ?>
		<p class="no-comments">Essa postagem está protegida por senha.</p>
	<?php
		return;
	}
?>

<?php if ( $comments ) : /* You can start editing here. */ ?>

<div id="comments">

	    
	<div class="navigation">
		<div class="comment-nav-previous"><?php previous_comments_link(); ?></div>
		<div class="comment-nav-next"><?php next_comments_link(); ?></div>

    </div>
	
   
	<ol class="comment-list bord_5">
		<?php wp_list_comments(); ?>
	</ol>
	
    
    
	<div class="navigation">
		<div class="comment-nav-previous"><?php previous_comments_link(); ?></div>
		<div class="comment-nav-next"><?php next_comments_link(); ?></div>
	
    </div>

</div>

	<?php else : // this is displayed if there are no comments so far ?>
	
	<?php if ( 'open' == $post->comment_status ) : // If comments are open, but there are no comments. ?>
    	<?php else : // comments are closed ?>
		
 
        <div id="entry-comments">
            
             <p class="no-comments">Comments are closed.</p>
          
        </div>
	<?php endif; // if ( 'open' == $post->comment_status )  ?>
<?php endif; // if ( $comments ) ?>
    
<?php if ( 'open' == $post->comment_status ) : ?>


<div id="respond" class="fundo_caixa bord_5">
    
    <h3 id="leave-a-comment" class="fundo_brando bord_2"><?php comment_form_title( 'Dados para resposta', 'Responder à %s' ); ?></h3>
    
    <span id="cancel-comment-reply"><?php cancel_comment_reply_link('cancelar a resposta'); ?></span> 
   
    <?php if ( get_option( 'comment_registration' ) && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option( 'siteurl' ); ?>/wp-login.php?redirect_to=<?php echo urlencode( get_permalink() ); ?>">Logado</a> permissão para postar.</p>
    <?php else : ?>
	

	<form id="comment-form" method="post" action="<?php echo get_option( 'siteurl' ); ?>/wp-comments-post.php">
		<?php if ( $user_ID ) : ?>

        <p>Registrado como <a href="<?php echo get_option( 'siteurl' ); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="sair da conta">Sair &raquo;</a></p>
		
		<?php else : ?>
		
		<ul id="comment_box">
        <li><label for="author" class="<?php if ( $req ) echo 'required'; ?>">Nome</label><input name="author" id="author" type="text" value="<?php echo $comment_author; ?>" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
        </li>
        
        <li><label for="email" class="<?php if ( $req ) echo 'required'; ?>">Email</label><input name="email" id="email" type="text" value="<?php echo $comment_author_email; ?>" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
        </li>
        
        <li><label for="url">Website</label><input name="url" id="url" type="text" value="<?php echo $comment_author_url; ?>" tabindex="3" />
        </li> 
      </ul>
        
		<?php endif; ?>

        <p><textarea name="comment" id="comment" tabindex="4"></textarea></p>

        <p><button name="submit" id="submit" type="submit" tabindex="5">Enviar</button>
        <?php comment_id_fields(); ?><span class="allowed-tags"><abbr title="<?php echo allowed_tags(); ?>">Algum HTML funciona</abbr></span></p>

	<?php do_action( 'comment_form', $post->ID ); ?>

    </form>
    
	<?php endif; // If registration required and not logged in ?>

</div>
<?php endif; // (if ($comments)) - if you delete this the sky will fall on your head ?>